@extends('layout.layout')
@section('title')
	{{$title}}
@endsection
@section('css')
	table{
		border:1px solid #abc;
		text-align:center;
	}
	tr:nth-child(odd){
		background:#abc;
	}
	tr:nth-child(even){
		background:#ccc;
	}

	ul{
		list-style:none;
		margin:0;
		padding:0;
	}
	ul li{
		width:18px;
		height:18px;
		border:1px solid blue;
		float:left;
		margin:5px;
	}	
	#page{
		float:left;
		margin-left:550px;
		margin-top:20px;
	}

	#info{
		width:500px;
		height:50px;
		background:yellowgreen;
		cursor:pointer;
		color:#666;
		font-size:20px;
		line-height:50px;
	}
@endsection
@section('js')
	<script src="/js/jquery-1.10.2.min.js"></script>
	<script>
	$(function(){
		$('#info').click(function(){
			$(this).slideUp('slow');
		})
	})
	</script>
@endsection
@section('content')
	<table width="500" border="1" style="text-align:center">
		<caption><h3>用户列表</h3></caption>
		@if(session('info'))
		<div id="info">
			{{ session('info') }}
		</div>
		@endif
		
		<tr>
			<th>ID</th>
			<th>用户名</th>
			<th>性别</th>
			<th>年龄</th>
			<th>操作</th>
		</tr>
		@foreach($data as $k=>$v)
		<tr>
			<td>{{$v['id']}}</td>
			<td>{{$v['username']}}</td>
			<td>{{$v['sex']}}</td>
			<td>{{$v['age']}}</td>
			<td>
			<a href="/user/delete/{{$v['id']}}">删除</a>
			<a href="/user/edit/{{$v['id']}}">修改</a>
			</td>
		</tr>
		@endforeach
	</table>
	<!--显示分页-->
	<div id="page">{!!$data->render()!!}</div>
@endsection
